<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8"/>
    <!--强制让文档的宽度与设备的宽度保持1:1，并且文档最大的宽度比例是1.0，且不允许用户点击屏幕放大浏览-->
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <!--允许全屏模式浏览-->
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <!--指定的iphone中safari顶端的状态条的样式-->
    <meta content="black" name=" apple-mobile-web-app-status-bar-style"/>
    <!--去除Android平台中对邮箱地址的识别-->
    <meta content="email=no" name="format-detection"/>
    <meta http-equiv="Cache-Control" content="no-cache"/>
    <meta http-equiv="refresh" content="1500"/>
    <meta http-equiv="cleartype" content="on/off">
    <title>315加盟网</title>
    <link rel="icon" href="images/jmw.ico"/>
    <link type="text/css" rel="stylesheet" href="css/size.css"/>
    <link type="text/css" rel="stylesheet" href="css/index.css"/>
</head>
<body>
<div class="top">
    <img src="images/logo.png"/>
</div>

<!--导航-->
<div class="nav">
    <ul></ul>
</div>

<!--banner轮播-->
<div class="banner">
    <div class="banner-img"></div>
    <div class="banner-nav"></div>
</div>

<!--排行榜-->
<div class="ranklist">
    <div class="title">
        <em class="pub_x"></em>
        <img src="images/icon12.png">
        <span>2017商机排行榜</span>
        <em class="pub_x"></em>
    </div>
    <ul>
        <div class="num"></div>
    </ul>
</div>

<!--热搜排行-->
<div class="hot-search">
    <div class="title">
        <em class="pub_x"></em>
        <img src="images/icon11.png">
        <span>大家都在找</span>
        <em class="pub_x"></em>
    </div>
    <ul></ul>
</div>

<!--热门品牌-->
<div class="brand">
    <div class="title">
        <em class="pub_x"></em>
        <img src="images/icon13.png">
        <span>热门品牌</span>
        <em class="pub_x"></em>
        <p class="brand-btn"><img src="images/hyh.png"/>换一批</p>
    </div>
    <ul></ul>
</div>

<!--精选推送-->
<div class="push">
    <div class="title">
        <em class="pub_x"></em>
        <img src="images/icon14.png">
        <span>精选推送</span>
        <em class="pub_x"></em>
    </div>
    <ul></ul>
</div>

<!--页脚-->
<div class="foot">
    <p>粤ICP备12009797号-1奇人盛世（北京）文化传播有限公司</p>
</div>

</body>

<script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-88913818-5', 'auto');
    ga('send', 'pageview');

</script>

<script type="text/javascript" src="./js/jquery-3.0.0.min.js"></script>
<script type="text/javascript" src="./js/common.js"></script>
<script>
     //全局变量
    var HeatProjectWeights = 0;
    var bannerItem = 0;

    window.onload = function () {
        getHeatProjectList(0);
        getProjectCategory();
        getBannerList();
        getHotSearchList();
        getBusinessRankList();
        getProjectRankList();
        setInterval(banner, 2000)
    }

    /**
     * 热门品牌
     */
    $('.brand-btn').click(function () {
        getHeatProjectList(HeatProjectWeights)
    })

     /**
      * 幻灯片
      */
    function banner() {
        for (var j = 0; j < $('.banner-img a').length; j++) {
            $('.banner-img a').eq(j).hide();
        }
        $('.banner-img a').eq(0).show();
        bannerItem++;
        if (bannerItem == $('.banner-img p').length) {
            bannerItem = 0
        }
        if (bannerItem == $('.banner-nav p').length) {
            bannerItem = 0
        }
        $('.banner-img a').eq(bannerItem).show().siblings().hide();
        $('.banner-nav p').eq(bannerItem).css('background', '#fff').siblings().css('background', '#999');

    }

     /**
      * 导航
      */
    function getProjectCategory() {
        $.ajax({
            type: "GET",
            url: baseUrl + "/api/project/getProjectCategory/",
            dataType: "json",
            success: function (msg) {
                var stra = "";
                $(msg.data).each(function () {
                    var href = "sort.html?ID=" + this.id + "&name=" + encodeURI(this.name);
                    stra += "<li><a href='" + href + "'><img src='" + this.icon + "'><span>" + this.name + "</span> </a></li>"
                });

                $(".nav").html(stra);

            }
        })
    }

     /**
      * banner轮播
      */
    function getBannerList() {
        $.ajax({
            type: "GET",
            url: baseUrl + "/api/banner/getBannerList/",
            dataType: "json",
            success: function (msg) {
                var str = "";
                var strp = '';
                $(msg.data).each(function () {
                    var href = this.href
                    str += "<a href='" + href + "'><img src='" + this.thumb + "'></a>"
                    strp += '<p></p>'
                });

                $(".banner-img").html(str);
                $('.banner-nav').html(strp)

            }
        })
    }

     /**
      * 排行榜
      */
    function getBusinessRankList() {
        $.ajax({
            type: "GET",
            url: baseUrl + "/api/project/getBusinessRankList/",
            dataType: "json",
            success: function (msg) {
                var str = "";

                $(msg.data).each(function () {
                    str += "<li><a href='" + this.href + "' class='name'>[" + this.keywords + "]</a><a href='" + this.href + "' class='txt'>" + this.content + "</a></li>"
                });
                $(".ranklist ul").append(str);
                var strc = '';
                for (var j = 0; j < msg.data.length; j++) {
                    strc += "<li><em>" + (j + 1) + "</em></li>"
                }

                $('.num').html(strc)
            }
        })
    }

     /**
      * 热门品牌
      */
    function getHeatProjectList(endHeat) {
        $.ajax({
            type: "GET",
            url: baseUrl + "/api/project/getHeatProjectList/?endHeat=" + endHeat,
            dataType: "json",
            success: function (msg) {
                var str = '';
                $(msg.data).each(function () {
                    str += " <li class='rights tops'><a href='project.html?ID=" + this.id + "'><img src=" + this.thumb + "></a> <a href='#'>" + this.name + "</a></li>"

                    HeatProjectWeights = this.weight;

                });
                $('.brand ul').html(str)
            }
        })
    }

     /**
      * 热搜排行
      */
    function getHotSearchList() {

        $.ajax({
            type: "GET",
            url: baseUrl + "/api/hotSearch/getHotSearchList/",
            dataType: "json",
            success: function (msg) {
                var str = "";
                $(msg.data).each(function () {
                    str += "<li><a href=" + this.href + ">" + this.name + "</a></li>"
                });

                $(".hot-search ul").html(str);

            }
        })

    }

     /**
      * 精选推送
      */
    function getProjectRankList() {
        $.ajax({
            type: "GET",
            url: baseUrl + "/api/project/getProjectRankList/",
            dataType: "json",
            success: function (msg) {
                var str = '';
                for (var x = 0; x < msg.data.length; x++) {
                    str += RenderProjectItem(msg.data[x].project);
                }
                $('.push ul').html(str)
            }
        })
    }

</script>

<script type="text/javascript">
    var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
    document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fbff2ddba89ed4ec398871a0be83f3111' type='text/javascript'%3E%3C/script%3E"))

    document.write("<script type='text/javascript' src='http://zoosnet110001212.emmyma.com/images/9710931_stat/baidubridge'>");
</script>


</html>
